home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / WASTE Object Handlers 1.2.5 / Other Source / WASTE_Objects.c < prev   
Encoding:
Text File  |  1997-07-21  |  2.5 KB  |  118 lines  |  [TEXT/CWIE]

  1. // WASTE Object Archive intialization code
  2. // by Michael F. Kamprath, kamprath@kagi.com
  3. // maintenance by John C. Daub, hsoi@eden.com
  4. //
  5. // v1.0.1, 6 April 1995
  6. //
  7. // History
  8. //
  9. //        v1.0.1: Updated the handler installer calls to be compatible with v1.1a6
  10. //                of WASTE (CWATE v1.1r10 or later).
  11. //        v1.0.2: Updated the handler installer calls to be compatible with v1.1a8
  12. //                of WASTE (CWASTE v1.1r12 or later).  Basically, they now use UPPs.
  13. //                Code update actually done by Dan Crevier.
  14. //        v1.1:    Changed code to use individual object installers.
  15. //
  16. //        v1.2:    Updated calls to be compatabile with WASTE v1.2a5.
  17. //                - Added precompiler directives
  18. //                - InstallAllWASTEObjectHandlers() now takes a WEReference as an argument
  19. //                - Added Init/ExitWASTEObjectHandlers() to perform any startup/shutdown tasks
  20. //                  from within the library
  21. //                - Added DoObjectTasks() to facilitate handling of periodic object tasks
  22. //                - Added WEObjectPaste()
  23.  
  24. #ifndef __DRAG__
  25. #include <Drag.h>
  26. #endif
  27.  
  28. #ifndef _WASTE_
  29. #include "WASTE.h"
  30. #endif
  31.  
  32. #include "WE_hfs_Handler.h"
  33. #include "WE_PICT_Handler.h"
  34. #include "WE_snd_Handler.h"
  35.  
  36. #ifndef _WASTEOBJECTS_
  37. #include "WASTE_Objects.h"
  38. #endif
  39.  
  40. #ifndef true
  41. #define true 1
  42. #endif
  43.  
  44. #ifndef false
  45. #define false 0
  46. #endif
  47.  
  48.  
  49. //
  50. //    Installs ALL the object handlers in the given WASTE instance
  51. //  (or install all object handlers globally if passed nil)
  52. //
  53. OSErr   InstallAllWASTEObjHandlers( WEReference theWE )
  54. {
  55. OSErr   iErr;
  56.  
  57.     iErr = InstallPICTObject( theWE );
  58.     if (iErr) return(iErr);
  59.  
  60.     iErr = InstallSoundObject( theWE );
  61.     if (iErr) return(iErr);
  62.     
  63.     iErr = InstallHFSObject( theWE );
  64.     if (iErr) return(iErr);
  65.         
  66.     return(noErr);
  67. }
  68.  
  69. //
  70. //    InitWASTEObjectHandlers()
  71. //        Handles internal initializations (if any)
  72.  
  73. void    InitWASTEObjectHandlers( void )
  74. {
  75.     InitSoundObjectHandler();
  76. }
  77.  
  78. //
  79. //    ExitWASTEObjectHandlers()
  80. //        Handlers internal exit/clean-up (if any)
  81.  
  82. void    ExitWASTEObjectHandlers( void )
  83. {
  84.     // nothing now...here for future expansion
  85. }
  86.  
  87.  
  88. //
  89. //    DoObjectTasks()
  90. //        MUST be called periodically by your application (ideally in the main event loop)
  91. //        to handle object-related tasks
  92.  
  93. OSErr    DoObjectTasks( WEReference theWE )
  94. {
  95. #pragma unused (theWE)
  96.  
  97.     CheckSoundStatus();
  98.     
  99.     return noErr;
  100. }
  101.  
  102.  
  103. //
  104. //    WEObjectsPaste()
  105. //        Used in place of WEPaste to allow for handling of special object types
  106. //        (falls through to WEPaste then if needed)
  107.  
  108. pascal OSErr    WEObjectsPaste( WEReference hWE )
  109. {
  110. //    long        scrapOffset;
  111. //    OSErr        iErr;
  112.     
  113.     // check for object types that need special handling
  114.     
  115.     // (none currently)
  116.     
  117.     return WEPaste( hWE );
  118. }